package com.sneaker.shower.controller;

import com.sneaker.shower.entity.dto.DownloadBillReqDTO;
import com.sneaker.shower.service.WxFundFlowService;
import com.sneaker.shower.service.WxPayBillInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Hechangjian
 * @version 1.0
 * @className WxBillController
 * @date 2019/11/19 16:02
 * @description
 * @program bath
 */
@RestController
@RequestMapping("/wx")
@Slf4j
public class WxBillController {


    private final WxPayBillInfoService wxPayBillInfoService;

    private final WxFundFlowService wxFundFlowService;

    @Autowired
    public WxBillController(WxPayBillInfoService wxPayBillInfoService,
                            WxFundFlowService wxFundFlowService) {
        this.wxPayBillInfoService = wxPayBillInfoService;
        this.wxFundFlowService = wxFundFlowService;
    }

    @PostMapping("/download_bill")
    public void downloadBill(@RequestBody DownloadBillReqDTO reqDTO) {
        wxPayBillInfoService.downloadBill(reqDTO);
    }

    @PostMapping("/download_fund_flow")
    public void downloadFundFlow(@RequestBody DownloadBillReqDTO reqDTO) {
        wxFundFlowService.downloadFundFlow(reqDTO);
    }

}
